${page.setTitle("push-center| GOPS")}
<style type="text/css">
    .l-table-edit {}
    .l-table-edit-td{ padding:4px;}
    .l-button-submit,.l-button-reset{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
</style>
${token()}

<div class="body-pla-content">
  <form action="/certificate/upload" method="post" id="certificateForm" name="certificate" enctype="multipart/form-data">
        <table class="l-table-edit" >
            <tr>
                <td align="right" >appId：</td>
                <td align="left" >
						<input name="appId" type="text" id="appId"  maxlength="30" value=""  validate="{required:true,maxlength:30}"/>
				</td>
			 </tr> 
            <tr>
                <td align="right" >类型：</td>
                <td align="left" >
						<select name="type" id="type"  style="width: 130px" value=""  />
               			 <option value="" >--请选择--</option>
               			 <option value="0" >测试证书</option>
						 <option value="1" >线上证书</option>
						 <option value="2" >企业证书</option>
					</select>
				</td>
			 </tr> 
			 <tr>
                <td align="right" >名称：</td>
                <td align="left" >
						<input name="name" type="text" id="name"  maxlength="30" value=""  validate="{required:true,maxlength:30}"/>
				</td>
			 </tr> 
			 <tr>
                <td align="right" >证书：</td>
                <td align="left" >
						<input name="file" type="file" id="file"  validate="{required:true}"/>
				</td>
			 </tr> 
			 <tr>
                <td align="right" >密码：</td>
                <td align="left" >
						<input name="pwd" type="text" id="pwd"  maxlength="30" value=""  validate="{required:true,maxlength:30}"/>
				</td>
			 </tr> 
			 <tr>
                <td align="right" >状态：</td>
                <td align="left" >
						<select name="status" id="status"  style="width: 130px" value=""  />
               			 <option value="" >--请选择--</option>
               			 <option value="0" >停用</option>
						 <option value="1" >启用</option>
					</select>
				</td>
			 </tr> 
             <tr>
				 <td align="right" >备注：</td>
                <td align="left">
                <textarea rows="3" cols="40" name="memo" id="memo" ></textarea>
				</td>
            </tr>  
            <tr>
            	<td></td>
            	<td > <input type="button" value="新增" id="subitButton" class="l-button l-button-submit"/>  </td>
            	<td align="left"></td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">


$(function(){
		$("#subitButton").bind('click',function(){
			
			var appId=$("#appId").val();
			var name=$("#name").val();
			var type=$("#type").val();
			var file=$("#file").val();
			var pwd=$("#pwd").val();
			var status=$("#status").val();
			var memo=$("#memo").val();
			
			if(appId==""){
				alert("appId不可为空");
				return;
			}
			if(type==""){
				alert("类型不可为空");
				return;
			}
			if(file==""){
				alert("证书不可为空");
				return;
			}
			if(pwd==""){
				alert("密码不可为空");
				return;
			}
			if(status==""){
				alert("状态不可为空");
				return;
			}
			$("#certificateForm").submit();
		});
	});

</script>